#if !defined(__APP_BUFFER_H)     
#define __APP_BUFFER_H

#include <pthread.h>
#include "log/log.h"

typedef struct {
    char *ptr;  //缓存的指针
    int offset; //数据起始位置的偏移量
    int len ;   //数据长度
    int total_size; //缓存总大小  
}Buffer;

Buffer* app_buffer_init(int size);

int app_buffer_write(Buffer *buff, char *data, int len);

int app_buffer_read(Buffer *buff, char *data, int len);

int app_buffer_free(Buffer *buff);

#endif // __APP_BUFFER_H)    
